<?php
return array(
	'defaultScope' => array(
		'condition' => "object_type = 'Ticket'",
	),
	'attributeLabels' => array(
		'title' => '机票名称',
	),

	'relations' => array(
		'profile' => array(CActiveRecord::HAS_ONE, 'GoodsTicket', 'goods_id'),
	),

	'rules' => array(
		array('searchCity,departure_time,departure_city,landing_city,accommodation', 'safe'),
	),

	'behaviors' => array(
		'search' => array(
			'class' => 'application.behaviors.SearchBehavior',
			'timeSearch' => 'create_time',
			'priceSearch' => array(
				'attribute' => 'price_dealer',
				'alias' => 'priceInfo',
				'criteria' => array(
					'with' => 'priceInfo',
					'group' => 't.id'
				)
			),
			'searchModel' => 'TicketSearch'
		),
		'fornt' => array(
			'class' => 'coms.behaviors.FrontBehavior',
			'attributes' => array(
				'title' => 'title',
				'img' => 'thumb',
				'time' => array(
					'attribute' => 'create_time',
				),
			),
			'route' => 'provide/channel',
			'view' => 'ticketWrite'
		),
		'citycondtion' => array(
			'class' => 'application.behaviors.CitySearchCondition',
			'citys' => array(
				'departure_province',
				'departure_city',
			),
			'with' => array('profile')
		),
		'createName' => array(
			'class' => 'coms.behaviors.goods.TicketNameCreate'
		),
	),

	'class_id' => Goods::TYPE_TICKET,

	'_import' => array(
		array('*', 'models.Goods//*'),
		array('*', 'models.goods.activePrice//*'),
	),
);